﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CServiceStack.WebHost.Endpoints;
using SomeServices;
using CServiceStack.Text;
using CServiceStack.OrmLite;
using CServiceStack.Validation;

namespace SomeIISServiceHost
{
    public class MockServiceHost : AppHostBase
    {
        public MockServiceHost()
            : base(typeof(TingService).Assembly)
        {
            TingService.Init();
        }
        public override void Configure(Funq.Container container)
        {
            Plugins.Add(new ValidationFeature());
            container.RegisterValidator(typeof(RingRequestValidator));
            //Plugins.Add(new ProtuBufFormat())
            //JsConfig.DateHandler = JsonDateHandler.ISO8601;

            //// Set JSON web services to return idiomatic JSON camelCase properties
            //JsConfig.EmitCamelCaseNames = true;
            //container.Register<IDbConnectionFactory>(
            //    c => new OrmLiteConnectionFactory("~/App_Data/db.sqlite".MapHostAbsolutePath(), SqliteOrmLiteDialectProvider.Instance));
            //using (var restMovieService = container.Resolve<RestMoviceServiceImpl>())
            //{
            //    restMovieService.ResetMovie(null);
            //}
        }
    }
}